<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::Selector::AbstractSequence</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (A)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Selector.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector.html" title="Sass::Selector (module)">Selector</a></span>
     &raquo; 
    <span class="title">AbstractSequence</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Selector/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Selector/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::Selector::AbstractSequence 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">Sass::Selector::AbstractSequence</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>The abstract parent class of the various selector sequence classes.</p>

<p>All subclasses should implement a <code>members</code> method that returns an array of object that respond to <code>#line=</code> and <code>#filename=</code>, as well as a <code>to_a</code> method that returns an array of strings and script nodes.</p>

  </div>
</div>
<div class="tags">
  
</div><div id="subclasses">
  <h2>Direct Known Subclasses</h2>
  <p class="children"><a href="CommaSequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/CommaSequence.html" title="Sass::Selector::CommaSequence (class)">CommaSequence</a>, <a href="Sequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/Sequence.html" title="Sass::Selector::Sequence (class)">Sequence</a>, <a href="SimpleSequence.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector/SimpleSequence.html" title="Sass::Selector::SimpleSequence (class)">SimpleSequence</a></p>
</div>


  <h2>Instance Attribute Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#filename-instance_method" title="#filename (instance method)">- (String<sup>?</sup>) <strong>filename</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  

  
    <span class="summary_desc">The name of the file in which this selector was declared.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#line-instance_method" title="#line (instance method)">- (Fixnum) <strong>line</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  

  
    <span class="summary_desc">The line of the Sass template on which this selector was declared.</span>
  
</li>

    
  </ul>


  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#_specificity-instance_method" title="#_specificity (instance method)">- <strong>_specificity</strong>(arr) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#eql%3F-instance_method" title="#eql? (instance method)">- (Boolean) <strong>eql?</strong>(other) </a>
    

    
      (also: #==)
    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Checks equality between this and another object.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#has_placeholder%3F-instance_method" title="#has_placeholder? (instance method)">- (Boolean) <strong>has_placeholder?</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Whether or not this selector sequence contains a placeholder selector.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#hash-instance_method" title="#hash (instance method)">- (Fixnum) <strong>hash</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns a hash code for this sequence.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#specificity-instance_method" title="#specificity (instance method)">- (Fixnum) <strong>specificity</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Returns the specificity of the selector as an integer.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_s-instance_method" title="#to_s (instance method)">- (String) <strong>to_s</strong> </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Converts the selector into a string.</span>
  
</li>

    
  </ul>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id="filename=-instance_method"></span>
      <span id="filename-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="filename-instance_method">
  
    - (<tt>String</tt><sup>?</sup>) <strong>filename</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The name of the file in which this selector was declared.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


17
18
19</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 17</span>

def filename
  @filename
end</pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="line=-instance_method"></span>
      <span id="line-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="line-instance_method">
  
    - (<tt>Fixnum</tt>) <strong>line</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The line of the Sass template on which this selector was declared.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Fixnum</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


12
13
14</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 12</span>

def line
  @line
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="_specificity-instance_method">
  
    - <strong>_specificity</strong>(arr)  <span class="extras">(protected)</span>
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


87
88
89
90
91</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 87</span>

def _specificity(arr)
  spec = 0
  arr.map {|m| spec += m.is_a?(String) ? 0 : m.specificity}
  spec
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="eql?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>eql?</strong>(other) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='==-instance_method'>==</span></span>
    </span>
  
</p><div class="docstring">
  <div class="discussion">
    <p>Checks equality between this and another object.</p>

<p>Subclasses should define <code>#_eql?</code> rather than overriding this method, which handles checking class equality and hash equality.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Object</tt>)</span>
      
      
        <span class='name'>other</span>
      
      
      
        &mdash;
        The object to test equality against
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
        &mdash;
        Whether or not this is equal to <code>other</code>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


57
58
59</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 57</span>

def eql?(other)
  other.class == self.class && other.hash == self.hash && _eql?(other)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="has_placeholder?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>has_placeholder?</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Whether or not this selector sequence contains a placeholder selector. Checks recursively.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


64
65
66
67</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 64</span>

def has_placeholder?
  @has_placeholder ||=
    members.any? {|m| m.is_a?(AbstractSequence) ? m.has_placeholder? : m.is_a?(Placeholder)}
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="hash-instance_method">
  
    - (<tt>Fixnum</tt>) <strong>hash</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns a hash code for this sequence.</p>

<p>Subclasses should define <code>#_hash</code> rather than overriding this method, which automatically handles memoizing the result.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Fixnum</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


46
47
48</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 46</span>

def hash
  @_hash ||= _hash
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="specificity-instance_method">
  
    - (<tt>Fixnum</tt>) <strong>specificity</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the specificity of the selector as an integer. The base is given by <tt><a href="Selector.html#SPECIFICITY_BASE-constant" tppabs="http://sass-lang.com/docs/yardoc/Sass/Selector.html#SPECIFICITY_BASE-constant" title="Sass::Selector::SPECIFICITY_BASE (constant)">Sass::Selector::SPECIFICITY_BASE</a></tt>.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Fixnum</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


81
82
83</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 81</span>

def specificity
  _specificity(members)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="to_s-instance_method">
  
    - (<tt>String</tt>) <strong>to_s</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Converts the selector into a string. This is the standard selector string, along with any SassScript interpolation that may exist.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


73
74
75</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 73</span>

def to_s
  to_a.map {|e| e.is_a?(Sass::Script::Node) ? "\#{#{e.to_sass}}" : e}.join
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:37 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>